package com.zjj.dao;

import com.zjj.pojo.Worker;
import org.apache.ibatis.annotations.*;

public interface WorkerMapper {

    @Select("SELECT * FROM tb_worker WHERE id = #{id}")
    Worker selectWorker(int id);

    @Insert("INSERT INTO tb_worker(id, name, age, sex,worker_id) VALUES(#{id},#{name}, #{age}, #{sex}, #{worker_id})" )
    int insertWorker(Worker worker);

    @Update("UPDATE tb_worker SET name = #{name}, age = #{age} WHERE id = #{id}")
    int updateWorker(Worker worker);

    @Delete("DELETE FROM tb_worker WHERE id = #{id}")
    int deleteWorker(int id);

    @Select("SELECT * FROM tb_worker WHERE id = #{param01} AND name = #{param02}")
    Worker selectByWorkerByIdAndName(@Param("param01") int id,@Param("param02") String name);
}
